﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report2.aspx.cs" Inherits="Taxes.TaxesReport.Report2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var radioButtonCheck = function () {
            if (rd_Department.getValue() == true) {
                grid.getColumnModel().setColumnHeader(0, '部门名称');
            }
            if (rd_Person.getValue() == true) {
                grid.getColumnModel().setColumnHeader(0, '管理员名称');
            }
        }
        function init_rowclass(record, rowIndex, p, ds) {
            var cls = 'white-row';

            if (record.data.Precent >= 0 && record.data.Precent < 0.3) {
                var cls = '';
            }
            else if (record.data.Precent >= 0.3 && record.data.TPrecentax < 0.7) {
                var cls = '';
            }
            else if (record.data.Precent >= 0.7 && record.data.Precent <= 1) {
                var cls = '';
            }
            return cls;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
         <ext:Store ID="store" runat="server">
                    <Reader>
                        <ext:JsonReader>
                            <Fields>
                                <ext:RecordField Name="Name" Type="String">
                                </ext:RecordField>
                                <ext:RecordField Name="Industry" Type="String">
                                </ext:RecordField>
                                <ext:RecordField Name="Region" Type="String">
                                </ext:RecordField>
                                <ext:RecordField Name="Value" Type="Float">
                                </ext:RecordField>
                                <ext:RecordField Name="Precent" Type="Float">
                                </ext:RecordField>
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
        <ext:GridPanel StoreID="store" ID="grid" runat="server" Frame="true" StripeRows="true"
            Height="400" TrackMouseOver="True" AutoScroll="true">
            <LoadMask ShowMask="true" Msg="正在加载，请稍后." />
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" StoreID="store"
                    DisplayInfo="true">
                </ext:PagingToolbar>
            </BottomBar>
            <TopBar>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:RadioGroup ID="rg_tax_loaded" runat="server" ItemCls="x-check-group-base" FieldLabel="请选择排序方式">
                            <DirectEvents>
                                <Change OnEvent="RadioButtonCheck" />
                            </DirectEvents>
                            <Listeners>
                                <Change Fn="radioButtonCheck" />
                            </Listeners>
                            <Items>
                                <ext:Radio runat="server" ID="rd_Department" BoxLabel="按部门" Checked="true">
                                </ext:Radio>
                                <ext:Radio runat="server" Width="100" ID="rd_Person" BoxLabel="按管理员">
                                </ext:Radio>
                            </Items>
                        </ext:RadioGroup>
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <View>
                <ext:GridView EnableRowBody="true">
                    <GetRowClass Fn="init_rowclass" />
                </ext:GridView>
            </View>
            <ColumnModel>
                <Columns>
                    <ext:Column ColumnID="colColumnName" Header="部门名称" DataIndex="Name">
                    </ext:Column>
                    <ext:Column ColumnID="colIndustry" Header="行业" DataIndex="Industry">
                    </ext:Column>
                    <ext:Column ColumnID="colRegion" Header="区域" DataIndex="Region">
                    </ext:Column>
                    <ext:Column ColumnID="colIndustry" Header="平均缴纳房产税值" DataIndex="Value">
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Store>
               
            </Store>
        </ext:GridPanel>
    </div>
    </form>
</body>
</html>
